﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Threading;
using System.Collections;

namespace LucasCode.Tools
{
    public class ThreadQueue
    {
        private class WorkItem
        {
            public WorkItem(WaitCallback cb, object state)
            {
                this.callback = cb;
                this.state = state;
            }
            public WaitCallback callback { get; set; }
            public object state { get; set; }
        }
        private Queue<WorkItem> m_Queue = new Queue<WorkItem>();
        public void Enqueue(WaitCallback callback, object state)
        {
            lock(m_Queue)
                m_Queue.Enqueue(new WorkItem(callback, state));
        }

        private void ProcessQueue()
        {
            //
        }

        public void Enqueue(WaitCallback callback)
        {
            Enqueue(callback, null);
        }
    }
}
